#include "emailinfor.h"

EmailInfor* EmailInfor::_instance=nullptr;

EmailInfor* EmailInfor::GetInstance(QObject* parent){
    if(EmailInfor::_instance==nullptr)
        EmailInfor::_instance=new EmailInfor(parent);
    return EmailInfor::_instance;
}

EmailInfor::~EmailInfor(){

}

void EmailInfor::SubmitInfor(Yzty::ITEMCODE mcode,QVector<Yzty::BaceInfor*>& infors){
    std::lock_guard<std::mutex> glock(this->_mutex);
    this->_infors[mcode]=std::move(infors);
}

const QVector<Yzty::BaceInfor*>& EmailInfor::GetItemInfor(Yzty::ITEMCODE icode){
    std::lock_guard<std::mutex> glock(this->_mutex);
    return this->_infors[icode];
}

EmailInfor::EmailInfor(QObject* parent):QObject (parent){

}
